﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Graphics;

namespace Etapa1.ModelDescription
{
    public class Vertice
    {
        public Vertice(VertexPositionNormalTexture vertexInfo, int posInVertexList)
        {
            this.vertexInfo = vertexInfo;
            this.posInVertexList = posInVertexList;
        }

        List<Edge> edgeIn = new List<Edge>();

        public List<Edge> EdgesIn
        {
            get { return edgeIn; }            
        }
        List<Triangulo> triangulosIn = new List<Triangulo>();

        public List<Triangulo> TriangulosIn
        {
            get { return triangulosIn; }            
        }
        VertexPositionNormalTexture vertexInfo;
        int posInVertexList;

        public int PosInVertexList
        {
            get { return posInVertexList; }            
        }

        public VertexPositionNormalTexture VertexInfo
        {
            get { return vertexInfo; }
            set { vertexInfo = value; }     
        }


        public void addEdge(Edge edg)
        {
            
            edgeIn.Add(edg);
        }

        public void addTriangulo(Triangulo tri)
        {
            triangulosIn.Add(tri);
        }

        public int Valencia()
        {
            return edgeIn.Count;
        }
        public Edge GetAdjacentEdgeFromVertice(Vertice ver)
        {
            foreach (var item in edgeIn)
            {
                if (item.Vertices[0] == this && item.Vertices[1] == ver)
                    return item;
            }
            return null;
        }



    }
}
